package com.mxx.v3.web.controller;

import com.mxx.v3.dto.ChartData;
import com.mxx.v3.dto.ReportDto;
import com.mxx.v3.service.ReportService;
import com.mxx.v3.support.RestResponse;
import com.mxx.v3.web.query.ReportQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program:report-from-server
 * @description:报表的controller
 * @author:AlTuring
 * @Date:2019/11/2-12:13
 **/
@RestController
@RequestMapping(value = "/report")
public class ReportController {
    @Autowired
    private ReportService reportService;

    /**
     * 查询第1个九宫格的数据
     * @param reportQuery
     * @return
     */
    @GetMapping(value = "/chart1")
    public Object chart1(ReportQuery reportQuery){
        System.out.println("***请求了方法1***");
        Object chart1Data = reportService.getChart1Data(reportQuery);
        System.out.println("结果："+chart1Data);
        return new RestResponse(chart1Data);
    }

    /**
     * 查询第2个九宫格的数据
     * @param reportQuery
     * @return
     */
    @GetMapping(value = "/chart2")
    public Object chart2(ReportQuery reportQuery){
        System.out.println("***请求了方法2***");
        Object chart2Data = reportService.getChart2Data(reportQuery);
        System.out.println("结果："+chart2Data);
        return new RestResponse(chart2Data);
    }
    /**
     * 查询第3个九宫格的数据
     * @param reportQuery
     * @return
     */
    @GetMapping(value = "/chart3")
    public RestResponse chart3(ReportQuery reportQuery){
        System.out.println("***请求了方法3***");
        Object chart3Data = reportService.getChart3Data(reportQuery);
        System.out.println("结果："+chart3Data);
        return new RestResponse(chart3Data);
    }
    /**
     * 查询第4个九宫格的数据
     * @param reportQuery
     * @return
     */
    @GetMapping(value = "/chart4")
    public RestResponse chart4(ReportQuery reportQuery){
        System.out.println("***请求了方法4***");
        Object chart4Data = reportService.getChart4Data(reportQuery);
        System.out.println("结果："+chart4Data);
        return new RestResponse(chart4Data);
    }
    /**
     * 查询第5个九宫格的数据
     * @param reportQuery
     * @return
     */
    @GetMapping(value = "/chart5")
    public RestResponse chart5(ReportQuery reportQuery){
        System.out.println("***请求了方法5***");
        Object chart5Data = reportService.getChart5Data(reportQuery);
        System.out.println("结果："+chart5Data);
        return new RestResponse(chart5Data);
    }
    /**
     * 查询第6个九宫格的数据
     * @param reportQuery
     * @return
     */
    @GetMapping(value = "/chart6")
    public RestResponse chart6(ReportQuery reportQuery){
        System.out.println("***请求了方法6***");
        Object chart6Data = reportService.getChart6Data(reportQuery);
        System.out.println("结果："+chart6Data);
        return new RestResponse(chart6Data);
    }
    /**
     * 查询第7个九宫格的数据
     * @param reportQuery
     * @return
     */
    @GetMapping(value = "/chart7")
    public RestResponse chart7(ReportQuery reportQuery){
        System.out.println("***请求了方法7***");
        Object chart7Data = reportService.getChart7Data(reportQuery);
        System.out.println("结果："+chart7Data);
        return new RestResponse(chart7Data);
    }
    /**
     * 查询第8个九宫格的数据
     * @param reportQuery
     * @return
     */
    @GetMapping(value = "/chart8")
    public RestResponse chart8(ReportQuery reportQuery){
        System.out.println("***请求了方法8***");
        Object chart8Data = reportService.getChart8Data(reportQuery);
        System.out.println("结果："+chart8Data);
        return new RestResponse(chart8Data);
    }
    /**
     * 查询第9个九宫格的数据
     * @param reportQuery
     * @return
     */
    @GetMapping(value = "/chart9")
    public RestResponse chart9(ReportQuery reportQuery){
        System.out.println("***请求了方法9***");
        Object chart9Data = reportService.getChart9Data(reportQuery);
        System.out.println("结果："+chart9Data);
        return new RestResponse(chart9Data);
    }
}
